<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./Test.xhtml">



            <ui:define name="content">

                <fieldset style="height: 800px">
                    <legend><b>Update Events *</b></legend>


                    <center> <table width="716" height="513">
                            <tr>
                                <td><h2>Update Events!</h2></td>
                            </tr>

                            <tr>
                                <td>Category *</td>
                                <td>
                                    <h:selectOneMenu id="selectCat" value="#{eventBean.catId}" >
                                        <f:selectItems value="#{categoryBean.listAllCategory}" var="item" itemLabel="#{item.categoryName}" itemValue="#{item.categoryId}"/>
                                    </h:selectOneMenu>
                                </td>
                                <td> </td>


                            </tr>

                            <tr>
                                <td height="47">Event Title * </td>
                                <td><p:inputText value="#{eventBean.event.eventTitle}" id="txttitle" required="true" requiredMessage="Event title is not null">
                                        <f:validator validatorId="Validator.StringValidator"/></p:inputText>
                                </td>
                                <td><p:message for="txttitle"/></td>
                            </tr>

                            <tr>
                                <td height="45">Event Info * </td>
                                <td><p:editor  value="#{eventBean.event.eventInfo}" id="txtInfo" required="true" requiredMessage="Event info is not null"/></td>
                                <td><p:message for="txtInfo"/></td>
                            </tr>

                            <tr>
                                <td height="48">Event Images* </td>
                                <td><p:inputText value="#{eventBean.event.eventImg}" disabled="false"/></td>
                                <td>
                                    <p:growl id="messages" showSummary="true" showDetail="true" />
                                    <p:fileUpload fileUploadListener="#{eventBean.handleFileUpload}"
                                                  update="messages,uploadedFile"  sizeLimit="1073741824"
                                                  multiple="true" label="choose" allowTypes="*.jpg;*.png;*.gif;"
                                                  description="Images"/>
                                </td>


                            </tr>

                            <tr>
                                <td height="45">Release Date *</td>
                                <td><p:calendar value="#{eventBean.event.releaseDate}" id="txtreleaseDate" required="true" requiredMessage="ReleaseDate is not null"/>  </td>
                                <td><p:message for="txtreleaseDate"/></td>

                            </tr>

                            <tr>
                                <td height="45">End Date *</td>
                                <td><p:calendar value="#{eventBean.event.endDate}" id="txtendDate" required="true" requiredMessage="endDate is not null"/>  </td>
                                <td><p:message for="txtendDate"/></td>

                            </tr>
                            <tr>
                                <td height="61">Duration *</td>
                                <td><p:inputText value="#{eventBean.event.duration}" id="txtduration" required="true" requiredMessage="Duration is not null">
                                        <f:validator validatorId="Validator.CheckNumber"/></p:inputText>
                                </td>
                                <td><p:message for="txtduration"/></td>
                            </tr>
                            <tr>
                                <td height="65"></td>
                                <td>
                                    <h:commandButton value="Update" action="Event" actionListener="#{eventBean.updateEvent}" type="image" image="../resources/images/forms/form_submit.gif"/>
                                    <h:commandButton value="Cancel" action="Event" type="image" image="../resources/images/forms/form_reset.gif"/>
                                </td>
                                <td></td>
                            </tr>
                        </table>
                    </center>

                </fieldset>

            </ui:define>



        </ui:composition>

    </body>
</html>
